/*
 * v1.1 by tonydon site:txdnet.cn
 * netbeansIDE 7.1
 */
package cn.txdnet.txweb.utils;

import java.util.regex.Pattern;

/**
 *
 * @author txdnet
 */
public final class Constants {
    // 正则验证
    public static final Pattern RE_EMAIL = Pattern.compile("[a-zA-Z0-9\\-_\\.]{3,}+@+[a-zA-Z0-9\\-_\\.]{3,}");
    public static final Pattern RE_BYTE = Pattern.compile("[0-9]{1,2}");
    public static final Pattern RE_SHORT = Pattern.compile("[0-9]{1,5}");
    public static final Pattern RE_INT = Pattern.compile("[0-9]{1,9}");
    public static final Pattern RE_LONG = Pattern.compile("[0-9]{1,18}");
    public static final Pattern RE_TITLE = Pattern.compile("[^<>=\'\"]{2,64}");
    public static final Pattern RE_NICK = Pattern.compile("[a-zA-Z0-9\u4E00-\u9FA5]{2,16}");
    public static final Pattern RE_STRARR = Pattern.compile("[a-zA-Z0-9,_\\-/@]{1,512}");
    public static final Pattern RE_DATETIME = Pattern.compile("([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})");
    public static final Pattern RE_DOUBLE = Pattern.compile("([0-9\\-]{1,15})\\.([0-9]{1,2})");
    public static final Pattern RE_TEL = Pattern.compile("((\\(\\d{2,3}\\))|(\\d{3}\\-))?(13|15|18)\\d{9}");
    
    // 去掉 /* ... */ //... \n\r 注释
    public static final Pattern RE_CLR_NOTE = Pattern.compile("(\\/\\*[\\s\\S]*?\\*\\/)|(\\/\\/.*[\n\r]{1,})");
    
    // 定义会话常量
    public static final String SN_MGR = "txcms_session_mgr";
    public static final String SN_VCODE = "txcms_session_vcode";

    // JSP模板页面根属性缺省名称
    public static final String JSP_ATTR_DEFAULT_NAME = "root";
}
